
#ifndef DEBUG_H
#define DEBUG_H

#include <cstdio>

#ifndef _DEBUG
#define debugPrint(fmt, ...)
#define allocateConsole()
#endif

#ifdef _DEBUG


#define debugPrint(fmt, ...)    \
do {                          \
fprintf(stderr,             \
"%s:%d:%s(): " fmt, \
__FILE__,           \
__LINE__,           \
__func__,           \
__VA_ARGS__);       \
} while (0)


#define allocateConsole()            \
do {                               \
AllocConsole();                  \
freopen("CONIN$", "r", stdin);   \
freopen("CONOUT$", "w", stdout); \
freopen("CONOUT$", "w", stderr); \
} while (0)
#endif

#endif  // DEBUG_H